// class Person extends Object{

// }

class HYArray extends Array {
  firstItem() {
    return this[0]
  }
  lastItem() {
    return this[this.length - 1]
  }
}

var arr1 = new HYArray(1, 2, 3)
var arr2 = [1, 2, 3]
console.log(arr1.firstItem());
console.log(arr1.lastItem());